package com.linwen.javase.desgin_pattern.action.memento;

/**
 * @ClassName Originator
 * @Description
 * @Author lin
 * @Date 2022/6/29 上午1:32
 * @Version V1.0
 */

//发起人
class Originator {
    private String state;
    public void setState(String state) {
        this.state = state;
    }
    public String getState() {
        return state;
    }
    public Memento createMemento() {
        return new Memento(state);
    }
    public void restoreMemento(Memento m) {
        this.setState(m.getState());
    }
}